﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace PlusPlusPaint.GUI
{
    public class MainWindow : Form
    {
        MenuStrip menuStrip;

        public MainWindow()
        {   this.ClientSize = new Size(800, 600);
            this.MinimumSize = new Size(400, 300);
            menuStrip = new MenuStrip();
            this.Controls.Add(menuStrip);
            this.makeFileMenu();
            this.makeHelpMenu();
            this.Text = "++Paint";
            this.IsMdiContainer = true;
            this.MainMenuStrip = menuStrip;
        }
        private void makeFileMenu()
        {   ToolStripDropDownItem menu;
            menu = new ToolStripMenuItem("File");
            menu.DropDownItems.Add("New", null, this.newSketch);
            menu.DropDownItems.Add("Exit", null, this.exitAll);
            menuStrip.Items.Add(menu);
        }
        private void makeHelpMenu()
        {   ToolStripDropDownItem menu;
            menu = new ToolStripMenuItem("Help");
            menu.DropDownItems.Add("About \"++Paint\"", null, this.displayAboutBox);
            menuStrip.Items.Add(menu);
        }
        private void displayAboutBox(object o, EventArgs ea)
        {   MessageBox.Show("++Paint V2.0 \nA.M. Golov & R. van den Broek \nUU Informatica 2011"
                           , "About \"++Paint\""
                           , MessageBoxButtons.OK
                           , MessageBoxIcon.Information
                           );
        }

        private void newSketch(object sender, EventArgs e)
        {   SketchWindow s = new SketchWindow();
            s.MdiParent = this;
            s.Show();
        }

        private void exitAll(object sender, EventArgs e)
        {   this.Close();
        }
    }
}
